package cn.edu.lcu.cs.basic.program_principle.dependence_inversion;

//import org.springframework.beans.factory.annotation.Autowired;

public class UserController {
    /**
     * 由第三方框架自动注入依赖的Bean
     * 面向接口编程，而不是实现类
     */
//    @Autowired
    private UserService userService;

    public UserController() {
//        userService = new UserServiceImpl();
    }

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public boolean login(String username, String password) {
        return userService.login(username, password);
    }

}
